

package top.continew.admin.question.service;

import top.continew.admin.question.model.LearningSummary;
import java.util.concurrent.CompletableFuture;

/**
 * 学习总结服务接口
 */
public interface LearningSummaryService {

    /**
     * 生成学习总结
     *
     * @param questionSetId     题集ID
     * @param userId            用户ID
     * @param questionAndAnswer 题目和答案的JSON数据
     * @param knowledge         相关知识点
     * @return 学习总结数据
     * @throws Exception 处理异常
     */
    LearningSummary generateSummary(Long questionSetId,
                                    Long userId,
                                    String questionAndAnswer,
                                    String knowledge) throws Exception;

    /**
     * 异步生成学习总结
     *
     * @param questionSetId     题集ID
     * @param userId            用户ID
     * @param questionAndAnswer 题目和答案的JSON数据
     * @param knowledge         相关知识点
     * @return 异步任务对象
     */
    CompletableFuture<LearningSummary> generateSummaryAsync(Long questionSetId,
                                                            Long userId,
                                                            String questionAndAnswer,
                                                            String knowledge);

    /**
     * 根据用户做题记录ID查询学习总结
     *
     * @return 学习总结数据
     */
    LearningSummary getByUserDoQuestionSetId(Long userId, Long questionSetId);
}